Thread synchronization is a technique for a concurrent execution of multiple threads. A thread or a thread of execution is a software unit. In a multi-processor/multi-core system, multiple threads can be executed in parallel. That is, each of the processors or cores may execute a thread simultaneously. Thread synchronization ensures that these multiple threads cooperate to spread the workload to be executed efficiently between the multiple threads. One thread can pass a request to another thread to cause it to be executed.
In computer systems, shared memory may refer to memory that can be accessed simultaneously by different resources, such as computer hardware or software. In computer hardware, shared memory is typically random access memory (RAM) that is accessible from different central processing units (CPUs) in a multi-processor system. In computer software, shared memory generally refers to an area of RAM that is accessible to multiple processes or threads. In software systems, such availability allows a single copy of data to service multiple resources, instead of providing a separate copy of the data for each specific resource.